package com.ccp.dev.system.model;

import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.ToStringBuilder;
import java.util.Date;

/**
 * ClassDescribe:文件管理日志实体
 * Author :zhaowanjing
 * Date: 2018-05-17
 */
public class FileManagementLog {

    /**
     * ID
     */
    private String id;

    /**
     * 被操作的文件/文件夹ID
     */
    private String fileId;

    /**
     * 被操作的文件/文件夹名称
     */
    private String fileName;

    /**
     * 被操作的文件存储路径 文件夹为空
     */
    private String fileStorage;

    /**
     * 操作类型 1上传 2下载 3删除 4重命名
     */
    private Integer operatorType;

    /**
     * 操作者ID
     */
    private String operatorId;


    /**
     * 操作者姓名
     */
    private String operatorName;


    /**
     * 操作时间
     */
    private Date operatorDate;

    public FileManagementLog() {
        super();
    }

    public String getFileName() {
        return fileName;
    }

    public void setFileName(String fileName) {
        this.fileName = fileName == null ? null : fileName.trim();
    }

    public String getFileStorage() {
        return fileStorage;
    }

    public void setFileStorage(String fileStorage) {
        this.fileStorage = fileStorage == null ? null : fileStorage.trim();
    }

    public Integer getOperatorType() {
        return operatorType;
    }

    public void setOperatorType(Integer operatorType) {
        this.operatorType = operatorType;
    }

    public String getOperatorName() {
        return operatorName;
    }

    public void setOperatorName(String operatorName) {
        this.operatorName = operatorName == null ? null : operatorName.trim();
    }

    public Date getOperatorDate() {
        return operatorDate;
    }

    public void setOperatorDate(Date operatorDate) {
        this.operatorDate = operatorDate;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getFileId() {
        return fileId;
    }

    public void setFileId(String fileId) {
        this.fileId = fileId;
    }

    public String getOperatorId() {
        return operatorId;
    }

    public void setOperatorId(String operatorId) {
        this.operatorId = operatorId;
    }

    /**
     * @see Object#equals(Object)
     */
    @Override
    public boolean equals(Object object) {
        if (!(object instanceof Resources)) {
            return false;
        }
        FileManagementLog rhs = (FileManagementLog) object;
        return new EqualsBuilder()
                .append(this.id, rhs.id)
                .append(this.fileId, rhs.fileName)
                .append(this.fileName, rhs.fileName)
                .append(this.fileStorage, rhs.fileStorage)
                .append(this.operatorType, rhs.operatorType)
                .append(this.operatorId, rhs.operatorId)
                .append(this.operatorName, rhs.operatorName)
                .append(this.operatorDate, rhs.operatorDate)
                .isEquals();
    }


    /**
     * @see Object#toString()
     */
    @Override
    public String toString() {
        return new ToStringBuilder(this)
                .append("id", this.id)
                .append("fileId", this.fileId)
                .append("fileName", this.fileName)
                .append("fileStorage", this.fileStorage)
                .append("operatorType", this.operatorType)
                .append("operatorId", this.operatorId)
                .append("operatorName", this.operatorName)
                .append("operatorData", this.operatorDate)
                .toString();
    }
}
